#Rscript hist.R data.txt name xname
args <- commandArgs(TRUE)
data <- args[1]
name <- args[2]
xname <- args[3]
input <- scan(data)
#input2 <- input
#n <- length(input2)
#for (i in 1:n) if (input2[i] == 0) input2[i] <- 1
#gm <- exp(mean(log(input2)))
avg = mean(input)
top <- max(input)
stdev <- sd(input)
pdf(paste(name, ".pdf", sep=""))
hist(input, breaks=c(floor(min(input)):ceiling(max(input))), xlab = xname, main=paste("mean: ", format(avg,digits=3, width=0), ", max: ", top, ", stdev: ", format(stdev,digits=3,width=0), sep=""), col="lightblue")
